package edu.uj.petri.document;

import edu.uj.petri.gui.MainWindowInterface;
import edu.uj.petri.commands.Command;
import edu.uj.petri.commands.CommandException;

/**
 * operating mode of an document.
 * @author Piotrek
 */
interface Mode {
    
    /**
     * this method is called when document mode is changed to this mode.
     */
    public void applyTo(MainWindowInterface window, Document document);
    
    /**
     * this method is called when this document mode is switched away and
     * another mode is set instead
     */
    public void finish(MainWindowInterface window, Document document);

    /**
     * undoes one command
     */
    public void undo() throws CommandException;

    /**
     * redoes one command 
     */
    public void redo() throws CommandException;

    /**
     * executes this command
     */
    public void execute(Command command);
}
